﻿using Hsp.WebNovels.Model.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SqlSugar;
using Hsp.WebNovels.Common.Constants;

namespace Hsp.WebNovels.Model.Dtos
{
    /// <summary>
    /// 章节数据传输对象
    /// </summary>
    public class ChapterDto : Chapter
    {
        #region 分页数据属性

        /// <summary>
        /// 记录行号
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public int RowNumber { get; set; }

        /// <summary>
        /// 记录总数
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public int RecordCount { get; set; }

        #endregion

        /// <summary>
        /// 章节内容
        /// </summary>
        [DisplayName("章节内容")]
        //[StringLength(-1)]
        public string? Contents { get; set; }

        /// <summary>
        /// 有效章节：0-否；1-是；
        /// </summary>
        [DisplayName("有效章节")]
        public string? ValidChapterName
        {
            get
            {
                return ValidChapter.HasValue ? EnumsHelper.GetName((EnumValidChapter)ValidChapter) : "";
            }
        }

        /// <summary>
        /// 网站编号
        /// </summary>
        public string? WebId { get; set; }

        /// <summary>
        /// 站点名称
        /// </summary>
        public string? WebName { get; set; }

        /// <summary>
        /// 小说名称
        /// </summary>
        public string? NovelName { get; set; }

    }
}
